import request from '@/config/axios'

// 费用列表
export const getExpenseList = (data) => {
  return request.get({
    url: '/service/expense/page',
    params: data
  })
}

// 详情
export const getExpenseDetail = (id) => {
  return request.get({
    url: '/service/expense/get',
    params: { id }
  })
}

// 获取费用明细
export const getExpenditureDetail = (data) => {
  return request.get({
    url: '/service/expense/get-expense-detail',
    params: data
  })
}

// 新增
export const addExpense = (data) => {
  return request.post({
    url: '/service/expense/create',
    data,
  })
}

// 编辑
export const editExpense = (data) => {
  return request.put({
    url: '/service/expense/update',
    data,
  })
}

// 删除
export const deleteExpense = (id) => {
  return request.delete({
    url: '/service/expense/delete',
    params: { id }
  })
}

// 作废
export const voidExpense = (data) => {
  return request.post({
    url: '/service/expense/update-expense-status',
    params: data
  })
}

// 导出
export const exportExpense = (data) => {
  return request.download({
    url: '/service/expense/export-excel',
    params: data,
  })
}